<template>
  <div class="comingSoon">
    <img
      src="../../assets/newPage/comming.png"
      @click="toList"
    >
  </div>
</template>

<script>
	export default {
		name: "",
		components: {},
		props: {
			data: {
				type: Object,
				// 对象或数组默认值必须从一个工厂函数获取
				default: function() {
					return {};
				},
			},
		},
		data() {
			return {
				list: [],
				count: "",
			};
		},
		mounted() {
			let params = {
				queryCondition: {
					order: [{
						fieldname: "iOrder",
						direction: "asc",
					}, ],
					pageindex: 1,
					pagesize: 16,
					where: [{
						fieldname: "tag_id",
						valuefrom: this.data.connect_id,
					}, ],
				},
			};

			this.$api.home.getProductList(params).then((res) => {
				if (res.code == 200) {
					this.list = res.data.data;
					this.count = Math.ceil(res.data.data.length / 2);
				}
			});
		},
		methods: {
			toList() {
				this.$router.push({
					path: "/today",
					query: {
						id: this.data.connect_id,
					},
				});
			},
			// 跳转商品详情
			goDetail(item) {
				console.log('跳转商品详情', item)
				this.$router.push({
					path: "/fruit/detail",
					query: {
						id: item.pid,
						iShopId: item.iShopId
					},
				});
			},
		},
	};
</script>

<style scoped lang="scss">
	.comingSoon {
		width:100%;
		margin-top: 0rem;
		margin-bottom: -10rem;
		// margin-left: -5rem;
		// margin-right: -2rem;
		display: flex;
		flex-direction: column;
		overflow: hidden;
		img{
			width: 100%;
			cursor: pointer;
		}
		
	}
</style>
